package lohr.lang.dom;


/**
 * A string that identifies an object in a namespace.
 * May have optional type parameters
 * 
 * Examples: 
 * 		person
 * 		Set<Integer>
 * 
 * @author ted stockwell
 *
 */
public class IdentifierName extends LohrElement {
	private String _name;
	private TypeParameterDeclaration _parameters;
	
	public IdentifierName(String name) {
		this(name, null);
	}
	public IdentifierName(String name, TypeParameterDeclaration parameters) {
		_name= name;
		if ((_parameters= parameters) != null) {
			addChild(_parameters);
		}
	}
	
	public IdentifierName(IdentifierName identifierName, TypeParameterDeclaration parameterDeclaration) {
		_name= identifierName.getName();
		if ((_parameters= parameterDeclaration) != null)
			addChild(_parameters);
	}
	public String getName() {
		return _name;
	}
	
	public TypeParameterDeclaration getTypeParameterDeclaration() {
		return _parameters;
	}
	
	@Override
	public String toString() {
		String s= _name;
		if (_parameters != null) 
			s+= _parameters.toString();
		return s;
	}
}
